num = int(input("zhuce cishu:"))
zhuce = {}
key = []
for i in range(num):
    name = input("name:").lower().strip()
    password = input("password:").strip()
    password2 = input("password2:").strip()
    n = len(name)
    p = len(password)
    if n == 0 or password == 0:
        print("name or password is kong")
    else:
        if name in key:
            print("name cun zai")
        else:
            if not ((6 < n < 13 ) and ( 6 < p < 13)):
                print("用户名和密码只能大于6位，小于13位")
            elif password.isdigit():
                print("密码不能为纯数字")
            elif password != password2:
                print("两次密码不一致")
            else:
                if zhuce.get(name) == None:
                    zhuce[name] = password
                    # print(zhuce)
                    mark = []
                    for k, v in zhuce.items():
                        mark.append('%s:%s'%(k,v))
                        f = open('zhuce.txt', 'w', encoding='utf-8')
                        f.write('\n'.join(mark))  # 只能是写字符串
                        f.close()
                else:
                    print("用户已存在")